import request from '@/utils/request'

export function add(data) {
  return request({
    url: '/sysPost',
    method: 'post',
    data
  })
}

export function del(data) {
  return request({
    url: '/sysPost',
    method: 'delete',
    data
  })
}

export function edit(data) {
  return request({
    url: '/sysPost',
    method: 'put',
    data
  })
}

export function getSysPost(id) {
  return request({
    url: '/sysPost/' + id,
    method: 'get'
  })
}

export function listSysPost(params, page) {
  return request({
    url: '/sysPost/list/' + page.pageNum + '/' + page.pageSize,
    method: 'get',
    params
  })
}

export function exportSysPost() {
  return request({
    url: '/sysPost/export',
    method: 'post',
    responseType: 'blob'
  })
}

export function listSysPostAll() {
  return request({
    url: '/sysPost/list',
    method: 'get'
  })
}

export default { add, edit, del, getSysPost, listSysPost, exportSysPost, listSysPostAll }
